﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Telerik.Web.UI;

namespace Landscape.Vessel.WebApp
{
    public partial class SiteMaster : System.Web.UI.MasterPage
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            
        }

        protected void rcbVessels_SelectedIndexChanged(object sender, RadComboBoxSelectedIndexChangedEventArgs e)
        {
            //AdministrativeBusinessActivities adminActs = new AdministrativeBusinessActivities();
            //if (e.Value != (new Guid()).ToString())
            //{
            //    this.rtvSysterms.DataSource = adminActs.GetTemplateMachineryByVesselCode(Guid.Parse(e.Value));
            //    this.rtvSysterms.DataBind();

            //    if (Session["ACTIV_VESSEL"] != null)
            //    {
            //        Session["ACTIV_VESSEL"] = e.Value;
            //    }
            //    else
            //    {
            //        Session.Add("ACTIV_VESSEL", e.Value);
            //    }
            //}
            //else
            //{
            //    this.rtvSysterms.Nodes.Clear();

            //    if (Session["ACTIV_VESSEL"] != null)
            //    {
            //        Session.Remove("ACTIV_VESSEL");
            //    }

            //    if (Session["ACTIV_SYSTEM"] != null)
            //    {
            //        Session.Remove("ACTIV_SYSTEM");
            //    }
            //}
        }

        protected void rtvSysterms_NodeDataBound(object sender, RadTreeNodeEventArgs e)
        {
            //e.Node.Text = (e.Node.DataItem as TemplateMachinery).MachineItem.Name;
        }

        protected void rtvSysterms_NodeClick(object sender, RadTreeNodeEventArgs e)
        {
            if (Session["ACTIV_SYSTEM"] != null)
            {
                Session["ACTIV_SYSTEM"] = e.Node.Value;
            }
            else
            {
                Session.Add("ACTIV_SYSTEM", e.Node.Value);
            }
        }

        protected void RadContextMenu1_ItemClick(object sender, RadMenuEventArgs e)
        {

        }       
    }
}
